//
// Created by Jisam on 2024/8/11 23:11.
// solve c
#include <bits/stdc++.h>

#define endl "\n"
#define PSI pair<string,int>
#define PII pair<int,int>
#define PDI pair<double,int>
#define PDD pair<double,double>
#define VVI vector<vector<int>>
#define VI vector<int>
#define VS vector<string>

#define PQLI priority_queue<int, vector<int>, less<int>>
#define PQGI priority_queue<int, vector<int>, greater<int>>
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;

using namespace std;


void solve() {
    int n;
    cin >> n;
    vector<pair<int,int>> a(n);
    for(int i = 0 ; i < n ; i ++){
        cin >> a[i].first >> a[i].second;
    }
    int x1 ,x2 ,y1,y2;
    cin >> x1 >> y1 >> x2 >> y2;

    i64 dis = 1LL * (x1 - x2) * (x1 - x2)  + 1LL * (y1 - y2) * (y1 - y2);
    bool ok = true;
    for(int i = 0 ; i < n ; i ++){
        i64 res = 1LL * (a[i].first - x2)* (a[i].first - x2) + 1LL * (a[i].second - y2)* (a[i].second - y2);
        if(res <= dis)
        {
            ok = false;
            break;
        }
    }
    if (ok) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }


}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--) solve();
//    cout << "\n"[];
    return 0;
}